# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=qtawesome
pkgname=python-${_pkg}
pkgver=1.2.3
pkgrel=2
pkgdesc="Iconic fonts in PyQt and PySide applications"
arch=(any)
url="https://github.com/spyder-ide/qtawesome/"
license=(MIT)
depends=(python-qtpy)
makedepends=(python-setuptools)
checkdepends=(python-pytest python-pytest-qt pyside2 xorg-server-xvfb)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('5ae7552c0fc278fe07fc80c138a2ae811b38450c75fde16367497a3a309a15e0')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}-${pkgver}
  xvfb-run --auto-servernum python example.py
  PYTHONPATH="${PWD}"/build/lib xvfb-run --auto-servernum pytest -vv --color=yes qtawesome
}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
